After completing this lesson, you’ll be able to:
As a resident FME expert, you are often asked to translate data (particularly the community map) between formats. You realize that it would be much simpler if you created a workspace to do this - regardless of format - and let the end-users carry out the translation themselves. You've started to build a workspace, but now you need to add fanouts to make sure the users receive data in the form they expect.
Open the starting workspace in FME Workbench 2021.1 or later.
You can see from the Navigator that this workspace reads in a community map file Geodatabase and writes out to the Generic format:
The workspace provides four format choices to the user, controlled by User Parameters > OutputFormat.
The reader feature type is merged, meaning that it will read all features into one stream, rather than individual feature types per feature class. You can tell the feature type is configured that way because it is named <All>. Right now the writer feature type is set to write to a single feature type named NewFeatureType.
Examining the User Parameters shows that the workspace is configured to let the user choose which feature types to read. The user configured it this way by linking the FEATURE_TYPES parameter to the Reader Parameters > Features To Read > Feature Types to Read parameter.
If the workspace is run now, the user will be able to choose the feature types and format but will get the results back in a single layer/file. This result is obviously not optimal. Let's change the workspace so the user gets back separate layers/files for each feature type. We'll also zip the output for convenience.
We would like to output features to their original table. To do this we need to know where they came from, and that is obtained from a format attribute called fme_feature_type.
Inspect the properties for the writer feature type. Set a fanout by choosing fme_feature_type as the attribute supplying the feature type name.
Your dialog should look like this:
Click OK. The name of the feature type will change to <@Value(fme_feature_type)>
to reflect the use of a fanout.
In the Navigator, find the Destination Generic (Any Format) Folder writer parameter:
We will create a zipped folder to contain all of our files. Double click the parameter and set the location of an output folder (such as C:\FMEData\Output\Training
) then at the end type \CommunityMapping.zip
.
Your full parameter value will look something like this:
C:\FMEData\Output\Training\CommunityMapping.zip
This will create a zipped file called CommunityMapping.
Save the workspace and then run it with the prompt option set. When prompted, select some source tables to read (include at least the GarbageSchedule plus one other). Set Esri Shapefile as the format to write. Ensure your path reflects that you will be writing a zipped file:
Click the Run button to run the translation. Examine the output folder. A zipped folder has been created which contains all the selected tables that have been written back to Shapefile format:
Now you have a solution that almost anyone will be able to open and run for themselves. Also, if you published the workspace to FME Server it would automatically create a web page that matched the different user parameters.